package com.hzy.service.impl;

import com.hzy.dao.SysUserMapper;
import com.hzy.pojo.SysUser;
import com.hzy.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @Package: com.hzy.service.impl
 * @ClassName: SysUserServiceImpl
 * @Author: 862982795
 * @CreateTime: 2021/07/12 15:40
 * @Description:用户模块业务层实现
 */
@Transactional
@Service("sysUserService")
public class SysUserServiceImpl implements SysUserService {
    @Autowired
    private SysUserMapper sysUserMapper;
    @Override
    public List<SysUser> getList(SysUser sysUser) {
        try {
            return sysUserMapper.selectSysUserList(sysUser);
        }catch (RuntimeException e){
            e.printStackTrace();
            throw e;
        }
    }

    @Override
    public Integer addSysUser(SysUser sysUser) {
        return sysUserMapper.addSysUser(sysUser);
    }

    @Override
    public Integer deleteSysUser(Integer id) {
        return sysUserMapper.deleteSysUser(id);
    }

    @Override
    public Integer updateSysUser(SysUser sysUser) {
        return sysUserMapper.updateSysUser(sysUser);
    }

    public SysUserMapper getSysUserMapper() {
        return sysUserMapper;
    }

    public void setSysUserMapper(SysUserMapper sysUserMapper) {
        this.sysUserMapper = sysUserMapper;
    }
}
